package com.swyc.osschat.Common.Util.Tree;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 树状结构数据
 * @author yanyipeng.ykw@foxmail.com
 * @date 2019/3/20 14:10
 */
public class Tree<T,ID extends Serializable> implements Serializable{

    private ID id;

    private ID parentId;

    private T mine;

    private T parent;

    private List<Tree<T,ID>> child = new ArrayList<>();


    public ID getId() {
        return id;
    }

    public void setId(ID id) {
        this.id = id;
    }

    public ID getParentId() {
        return parentId;
    }

    public void setParentId(ID parentId) {
        this.parentId = parentId;
    }

    public T getMine() {
        return mine;
    }

    public void setMine(T mine) {
        this.mine = mine;
    }

    public T getParent() {
        return parent;
    }

    public void setParent(T parent) {
        this.parent = parent;
    }

    public List<Tree<T,ID>> getChild() {
        return child;
    }

    public void setChild(List<Tree<T,ID>> child) {
        this.child = child;
    }

    @Override
    public String toString() {
        return "Tree{" +
                "id=" + id +
                ", child=" + child +
                '}';
    }
}
